//
//  SinaWeiboSDK.h
//  MrWrite
//
//  Created by lilg on 13-7-24.
//  Copyright (c) 2013年 Founder. All rights reserved.
//

#import <UIKit/UIKit.h>

#define   SINA_OAuth                @"SinaOauth"
#define   SINA_Uid                     @"uid"
#define   SINA_AccessToken      @"accesstoken"
#define   SINA_ExpirationDate   @"expirationDate"

@class SinaWeiboSDK;

@protocol SinaWeiboDelegate <NSObject>
@optional
-(void)SinaWeiboDidLogin:(SinaWeiboSDK *)weiBo;
-(void)SinaWeiboDidLoginOut;
-(void)SinaWeiboDidShareSuccess:(BOOL)isSuceess;
-(void)SinaWeiboLoginFailed;
-(void)SinaWeiboCancelLogin;

@end

@interface SinaWeiboSDK : UIView<UIWebViewDelegate>
{
  NSString *_appKey;
  NSString *_appSecret;
  NSString *_redirectURI;
}

@property (nonatomic, assign)id<SinaWeiboDelegate>  delegate;
@property (nonatomic, retain)NSString  *accessToken;
@property (nonatomic, retain)NSString  *uid;
@property (nonatomic, retain)NSDate    *expirationDate;

+ (BOOL)HandleOpenURL:(NSURL *)url;


-(id)initWithFrame:(CGRect)frame andAppKey:(NSString *)appkey andAppSecret:(NSString *)appSecret andRedirectURI:(NSString *)redirectURI  delegate:(id<SinaWeiboDelegate>)weiBodelegate;

-(BOOL)isSessionValid;
-(void)SinaStartAuthorize;
-(void)SinaLoginOut;

-(void)shareThread:(NSArray *)_array;
@end
